package com.yjs.app.trade.transaction.controller;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yjs.app.trade.transaction.service.JPushAllService;

@Controller
@RequestMapping(value = "/transaction")
public class JPushController {
	
	@Autowired
	JPushAllService jPushAllService;
	
	/**
	 * 极光推送接口
	 * 
	 * @param parm
	 *            id:Android/IOS msg:通知内容
	 * @param parms
	 *            消息体
	 */
	@RequestMapping(value = "/jPush", method = RequestMethod.POST)
	@ResponseBody
	public void jpushAll(String jpushIds, String message) {
		// JSONObject invoiceInfo =
		// JSONObject.fromObject(DESUtils.getDecryptStr(data, "yjs_trade_app"));
		List<String> list = Arrays.asList(jpushIds.split(","));
		Map<String, String> param=new HashMap<>();
		param.put("msg", message);
		Map<String, String> parameter=new HashMap<>();
		jPushAllService.jpushAll(param, parameter, list);
		

	}

}
